<?php

namespace Apps\Common\Models;

/**
 * 广告Model
 * @author     chenxiaolin
 * @date        2016年1月19日
 * @version     2.0.0
 * @copyright   Copyright 2016 meelier.com
 */
class Advertisement extends \PhalconPlus\Database\Model
{

    /**
     *
     * @var integer
     */
    public $advertisement_id;
    
    /**
     *
     * @var string
     */
    public $advertisement_cover;
    
    /**
     *
     * @var string
     */
    public $advertisement_title;

    /**
     *
     * @var integer
     */
    public $city_id;
    
    /**
     *
     * @var integer
     */
    public $position;
    
    /**
     *
     * @var string
     */
    public $addtime;

    /**
     *
     * @var integer
     */
    public $type;

    /**
     *
     * @var string
     */
    public $advertisement_intro;

    /**
     *
     * @var string
     */
    public $out_link;
    

    /**
     * Returns table name mapped in the model.
     *
     * @return string
     */
    public function getSource()
    {
        return 'advertisement';
    }

    /**
     * Allows to query a set of records that match the specified conditions
     *
     * @param mixed $parameters
     * @return Activity[]
     */
    public static function find($parameters = null)
    {
        return parent::find($parameters);
    }

    /**
     * Allows to query the first record that match the specified conditions
     *
     * @param mixed $parameters
     * @return Activity
     */
    public static function findFirst($parameters = null)
    {
        return parent::findFirst($parameters);
    }

    /**
     * Independent Column Mapping.
     * Keys are the real names in the table and the values their names in the application
     *
     * @return array
     */
    public function columnMap()
    {
        return array(
            'advertisement_id' => 'advertisement_id',
            'advertisement_cover' => 'advertisement_cover',
            'advertisement_title' => 'advertisement_title',
            'city_id' => 'city_id',
            'position' => 'position',
            'addtime' => 'addtime',
            'type' => 'type',
            'advertisement_intro' => 'advertisement_intro',
            'out_link' => 'out_link',
        );
    }

    public function defaultColumns()
    {
        return [
            'addtime',
        ];
    }


}
